<template>
    <view class="mt80 pd">
        	<input type="text" value="" placeholder="输入昵称" class="jhhgerttyt " v-model="former.nickname"/>
    </view>
</template>
<script>
    export default {
        data() {
            return {
				former: {
					nickname: ''
				},
				avatar:""
			}
        },
        components: {},
        methods: {			
			async dengljse() {
				let cs = {}
				cs.nickname = this.former.nickname				
				if (!cs.nickname) {
					uni.showToast({
						title: '请输入昵称'
					});
					return false;
				}
				let jhsd = await this.get("/api/user", cs,'PUT')
				this.ures.nickname = cs.nickname
				uni.setStorageSync('uinfo',this.ures)
				console.log(this.ures)				
				// uni.redirectTo({
				// 	url: 'index'
				// })
				uni.navigateBack({
				    delta: 1
				});
			}
		},
		onNavigationBarButtonTap(e) {
			this.dengljse() 
		},
		onShow() { 
			console.log(111)			
			this.ures = uni.getStorageSync('uinfo');
			this.former.nickname = this.ures.nickname
			console.log(this.ures)
			console.log( this.$store.state)
		},		
        mounted() {}
    }

</script>
<style  scoped>

</style>
